# ### 加入购物车
# 请求网址:http://182.92.81.159:8080/wx/cart/add
# 请求方法:POST
# 请求头：
# Content-Type: application/json;charset=utf-8
# X-Litemall-Token:TOKEN
# 请求体：
# {"goodsId":1181000,"number":1,"productId":2}

# 导包
import requests
# 发送接口请求
resp = requests.post(url="http://192.168.127.152:8080/wx/auth/login",
              headers={"Content-Type":"application/json;charset=utf-8"},
              json={"username":"user123","password":"user123"})
# 获取响应数据
print(resp.json())


# 导包
import requests
# 发送接口请求
resp = requests.post(url="http://192.168.127.152:8080/wx/cart/add",
              headers={"Content-Type":"application/json;charset=utf-8",
                       "X-Litemall-Token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0aGlzIGlzIGxpdGVtYWxsIHRva2VuIiwiYXVkIjoiTUlOSUFQUCIsImlzcyI6IkxJVEVNQUxMIiwiZXhwIjoxNzQ3NzM0NTQyLCJ1c2VySWQiOjEsImlhdCI6MTc0NzcyNzM0Mn0.Dudggsb3OWr4FM5sIbsJrJXDTJmBaLdXdp23EAxKLGs"},
              json={"goodsId":1181000,"number":1,"productId":2})
# 获取响应信息
print(resp.json())
